﻿#region Styx Namespaces
using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.Routines;
#endregion

namespace GiwinMonk
{
    public partial class Monk : CombatRoutine
    {
        public bool InstantCast(string SpellName)
        {
            if (StyxWoW.Me.CurrentTarget != null &&
                SpellManager.CanCast(SpellName) &&
                StyxWoW.Me.IsSafelyFacing(StyxWoW.Me.CurrentTarget) &&
                !StyxWoW.Me.IsCasting &&
                !StyxWoW.Me.IsChanneling &&
                !SpellManager.GlobalCooldown &&
                StyxWoW.Me.CurrentTarget.InLineOfSight)
                SpellManager.Cast(SpellName);
                    Logging.Write("InstantCast: " + SpellName + 
                        " (Energy: " + StyxWoW.Me.CurrentEnergy +
                        ", Chi: " + StyxWoW.Me.CurrentChi.ToString() + ")");
                return true;
        }
    }
}
